#include <stdio.h>
#include <string.h>

void fit(char *string, unsigned int size) {
  if (strlen(string) > size) {
    *(string + size) = '\0';
  }
}

int main() {
  char p[100] = "hfawfhesriooeifjao";
  unsigned int size = 5;
  puts(p);
  fit(p, size);
  puts(p);
}